<template>
  <div>
    <header class="mint-header" style="font-size: 18px;">
      <div class="mint-header-button is-left">
        <button
          class="mint-button mint-button--default mint-button--normal"
          style="font-size: 15px;"
          @click="option"
        >
          <span class="mint-button-icon">
            <i class="mintui mintui-back"></i>
          </span>
          <label class="mint-button-text">返回</label>
        </button>
      </div>
      <h1 class="mint-header-title">培训记录</h1>
      <div class="mint-header-button is-right"></div>
    </header>
    <!-- <div style="height:40px"></div> -->
    <mt-search
      v-model="tcontent"
      cancel-text="取消"
      placeholder="查询"
      @keyup.enter.native="loadListData"
    ></mt-search>
    <div v-if="equilist.length==0">
      <img src="../static/zanwu.png" alt style="width:100%" />
      <div style="text-align:center;color:#35495e">暂无相关内容</div>
    </div>
    <div v-else>
      <div class="equi-div1" v-for="(item, index) in equilist" :key="index">
        <div class="equi-left">
          <h3 class="h3_equi">培训内容：{{item.hash.tcontent}}</h3>
          <div class="equi-div" style="display:flex">
            <span class="equi-span2">培训形式：{{item.hash.ttypename}}</span>｜
            <span class="equi-span2">培训分类：{{item.hash.classifyname}}</span>
          </div>
          <div class="equi-div" style="display:flex;margin-top:10px;">
            <span class="equi-span2">实际开始时间：{{item.hash.starttime}}__{{item.hash.endtime}}</span>
          </div>
          <div class="equi-div equi-gz">
            <span
              v-if="item.hash.has_cert=='1'"
              class="equi-span equi-shebei"
              style="margin-top:10px"
            >发证</span>
            <span v-else class="equi-span equi-shebei" style="margin-top:10px">不发证</span>
          </div>
        </div>
        <div class="equi-xq" @click="goequiinfo(item)">详情</div>
        <div style="clear:both"></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  data() {
    return {
      equilist: [],
      htitle: '培训记录',
      tcontent: '',
      ts: this.newStore()
    }
  },
  mounted() {
    const req = {
      handle:
        '33224548EFC2E94FE9F3B6004AA9373090D3E1223364DCF2BFF0B9210751F692',
      personid: localStorage.getItem('pid'),
      person2id: localStorage.getItem('pid')
    }
    this.spost(this.ts, '/mainservlet', req).then(ts => {
      this.equilist = ts.d.data.operation1
    })
  },
  methods: {
    goequiinfo(item) {
      this.$router.push({
        path: '/trainplaninfo',
        query: { id: item.hash.id }
      })
    },
    //查询
    loadListData() {
      const req = {
        handle:
          '33224548EFC2E94FE9F3B6004AA9373090D3E1223364DCF2BFF0B9210751F692',
        tcontent: this.tcontent
      }
      this.spost(this.ts, '/mainservlet', req).then(ts => {
        this.equilist = ts.d.data.operation1
      })
    },
    option() {
      this.$router.push({
        name: 'jbrhome',
        query: {
          name: ''
        }
      })
    }
  }
}
</script>
<style scoped>
.equi-div {
  font-size: 12px;
  line-height: 20px;
}
.equi-shebei {
  display: inline-block;
  padding: 1px 10px;
  color: #fff !important;
  background: rgb(51, 51, 51);
}
.h3_equi {
  font-size: 16px;
  font-weight: 400;
  line-height: 40px;
}
.equi-div1 {
  font-size: 16px;
  line-height: 25px;
  margin: 0 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}
.equi-span {
  color: #35495e;
}
.equi-xq {
  line-height: 90px;
  /* padding-left: 20px; */
  color: #26a2ff;
  float: right;
  /* background: #ddd; */
  margin-top: 5px;
  width: 20%;
  text-align: center;
  border-left: 1px solid #ddd;
}
.equi-left {
  width: 80%;
  float: left;
  padding-right: 0px;
}
.mint-search {
  height: 10vh;
}
.mint-searchbar {
  background-color: #ddd;
}
</style>
